   load('data/experiment-60min.mat'); 
            obj.inst_count_vec=inst_count_vec;
            obj.rt_vec=rt_vec;
            %----------
            n_st=3;% 1 state variable
            n_in= size(inst_count_vec,2);  %11 inputs
            n_out= 1; %size(rt_vec,2); % 1 output
            n_env=1; % environmental disturbances
           % A=ones(n_st,n_st); 
            A=[1 0 0
                  zeros(2,1) ones(2,2)];
            B=ones(n_st,n_in);
            K = [1;1;1]; % ones(n_st,n_env);
            C = [1 0 0];  % eye(n_out,n_st);
            D=zeros(n_out,n_in);
            
            % set the instances so around the desired point, allocatet your
            % self , 2 sec desire
            m_inst_count_vec = [2 1 3 4 1 1 1 1 1 0 0]; 
                    %  3     4     1     1     1     0     0     2     1     0     0
            users = 800; 
            m_rt_vec = obj.get_steady_state_output_for( m_inst_count_vec , users); 
           data = obj.build_iddata(inst_count_vec,rt_vec,m_inst_count_vec,m_rt_vec); 
            m=idss(A,B,C,D,K,'Ts', obj.samplingTime,'DisturbanceModel','Estimate','InitialState','Estimate');  % None            
            m.Cs = C;
    %        m.Ks = [NaN;NaN;NaN];
            m1=init(m);
            mm=pem(data,m1)
            
            obj.m=mm;
            obj.m_inst_count_vec=m_inst_count_vec;
            obj.m_rt_vec = m_rt_vec;           
            
            obj.sys = ss(obj.m); % ss(obj.m , 'm'); 
            kalm_sys = obj.sys; 
            obj.Q = 1; obj.R = 0;
      %      [kalmf,L,P,kalm_M] = kalman(kalm_sys,Q,R);
            obj.P=kalm_sys.b*obj.Q*kalm_sys.b';         % Initial error covariance
    %        obj.kalm_M = kalm_M;
    
           A=obj.sys.a;
           B=obj.sys.b;
           C=obj.sys.c;
           D=obj.sys.d;
           x0=obj.m.x0; 
          save('data/test_kalman.mat', 'x0', 'A','B','C','D','m_inst_count_vec', 'm_rt_vec');